package com.hb.trade.server.project.evaluation.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hb.core.pojo.project.evaluation.dto.EvaluationCommitteeDTO;
import com.hb.core.pojo.project.evaluation.dto.EvaluationCommitteeMembersDTO;
import com.hb.core.pojo.project.evaluation.entity.EvaluationCommitteeMembers;
import org.apache.ibatis.annotations.Param;
import org.fzzn.core.model.msg.Message;

import java.util.List;

/**
 * <p>
 * 评标委员会成员信息 服务类
 * </p>
 *
 * @author zhaojk
 * @since 2021-08-30
 */
public interface EvaluationCommitteeMembersService extends IService<EvaluationCommitteeMembers> {

    EvaluationCommitteeMembersDTO findByMemberIdCardAndPassword(String idCard, String password);
    EvaluationCommitteeMembersDTO findByMemberMobileAndPassword(String mobile, String password);
    /**
     *
     * @Description: 查询评委会下边的评委会专家
     * @Author: zhongdl
     * @Date:2022/2/15 13:59
     * @param evaluationCommitteeId:评委会id
     * @param memberTypes: 评委会成员类别
     * @return: {@link List< EvaluationCommitteeMembersDTO> }
     **/
    List<EvaluationCommitteeMembersDTO> listEvaluationCommitteeMember(Long evaluationCommitteeId, List<Integer> memberTypes);
    /**
     *
     * @Description: 根据得票的票数获得组长的id
     * @Author: zhongdl
     * @Date:2022/2/15 15:17
     * @param evaluationCommitteeId:
     * @return: {@link Long }
     **/
    Long votesCountLeaderId(Long evaluationCommitteeId);
    /**
     *
     * @Description: 判断评委会是否投票结束
     * @Author: zhongdl
     * @Date:2022/2/15 16:36
     * @param evaluationCommitteeId:
     * @return: {@link boolean }
     **/
    boolean voteEndFlag(Long evaluationCommitteeId);

    /**
     *
     * @Description:删除评委会所有的评委会成员
     * @Author: zhongdl
     * @Date:2022/2/15 17:09
     * @param evaluationCommitteeId:
     * @return: {@link boolean }
     **/
    boolean removeMembersByEvaluationCommitteeId(Long evaluationCommitteeId);


    /**
     * Description: 根据标段id查询当前标段下的专家身份证号
     * @author: fengbin
     * @date: 2022/2/24 15:32
     * @param sectionId
     @return: java.util.List<java.lang.String>
     */
    List<String>listExpertIdCardBySectionId ( Long sectionId);

    /**
     * 根据标段id查询评委会成员列表
     * @param sectionId
     * @return
     */
    List<EvaluationCommitteeMembers> findBySectionId(Long sectionId);


    /**
     * 重新指定专家
     * @author tian
     * @date 2022-4-18 9:11
     * @param evaluationCommitteeDTO
     * @return org.fzzn.core.model.msg.Message<java.lang.String>
     */
    Message<String> reassignExpert(EvaluationCommitteeDTO evaluationCommitteeDTO);


    /**
     * 重新指定组长
     * @author tian
     * @date 2022-4-18 9:11
     * @param evaluationCommitteeDTO
     * @return org.fzzn.core.model.msg.Message<java.lang.String>
     */
    Message<String> reassignLeaderExpert(EvaluationCommitteeDTO evaluationCommitteeDTO);



    /**
     * 查询标段下的评标专家id
     * @author tian
     * @date 2022-4-20 11:35
     * @param sectionId 标段id
     * @param chairmanFlag 是否为组长  1：是   0：否
     * @return java.util.List<java.lang.Long>
     */
    List<EvaluationCommitteeMembers> selectCommitteeMembersBySectionId(Long sectionId, String chairmanFlag);

    /**
     * 判断评委会是否已经开始评标
     * 判断条件：任意一位评委选举了组长并且确认了承诺书
     * @param evaluationCommitteeId
     * @return
     */
    Boolean evaluationStarted(Long evaluationCommitteeId);


    /**
     * 查评委会会专家信息
     *
     * @author tian
     * @date 2022-6-18 14:37
     * @param evaluationCommitteeMembers
     * @return java.util.List<com.hb.core.pojo.project.evaluation.entity.EvaluationCommitteeMembers>
     */
    List<EvaluationCommitteeMembers> selectInfoByEvaluationCommitteeIdAndMemberType(EvaluationCommitteeMembers evaluationCommitteeMembers);

}
